aspect parameter validation [closed]

Posted by user12558 on Programmers See other posts from Programmers or by user12558
Published on 2011-01-06T18:20:03Z Indexed on 2011/01/06 18:57 UTC
Read the original article Hit count: 133

Filed under:

Hi, Im doing a POC using Aspectj.

class BaseInfo{..}

class UserInfo extends BaseInfo{..}

class UserService {

public void getUser(UserInfo userInfo){..}

public void deleteUser(String userId){..}

}

I've defined an advice, that gets invoked when I pass an UserInfo instance.But when i try to pass the BaseInfo, the advice is not getting invoked.

Below block executes the afterMethod as expected for getUser.

&ltaop:pointcut id="aopafterMethod" expression="execution(* UserService.*(..,UserInfo,..))" />

&gtaop:after pointcut-ref="aopafterMethod" method="afterMethod" />

But when i try to give BaseInfo instead of UserInfo, the aspect is not getting triggered.

Am i missing something? Kindly help me on this issue.

© Programmers or respective owner

Related posts about spring